package bootstrap

import (
	"card/config"
	"card/pkg/cache"
	"fmt"
)

// SetupCache 缓存
func SetupCache() {

	// 初始化缓存专用的 redis client, 使用专属缓存 DB
	rds := cache.NewRedisStore(
		fmt.Sprintf("%v:%v", config.Application.Redis.Host, config.Application.Redis.Port),
		config.Application.Redis.Username,
		config.Application.Redis.Password,
		config.Application.Redis.Database,
	)
	cache.InitWithCacheStore(rds)
}
